package com.mall.mymall.controller;


import com.mall.mymall.common.Result;
import com.mall.mymall.dao.dto.UserProfileDto;
import com.mall.mymall.dao.entity.Users;
import com.mall.mymall.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 十里坡
 * @since 2025-04-01
 */
@RestController
@RequestMapping("/userInfo")
public class UserInfoController {

    @Autowired
    UserInfoService userInfoService;

    @PostMapping("/profile")
    public Result<UserProfileDto> profile(@RequestBody Users users){
        UserProfileDto userProfileDto = userInfoService.getUserProfile(users);
        return Result.success(userProfileDto);
    }
}

